prices <- tq_get(params$symbol, "stock.prices") %>%
filter_by_time(date, params$startdate, params$enddate)
close <- Cl(last(prices))
open <- Op(last(prices))
raw_fname <- paste0(params$symbol, "_", Sys.Date(), ".csv")
write.csv(prices, raw_fname)
rmarkdown::output_metadata$set(rsc_output_files = list(raw_fname))
The stock TSLA closed up at $691.62 per share yesterday.
This report contains data from 2011-01-01 to 2021-04-07
The chart below is made with the timetk R package, which helps easily draw great-looking static (ggplot2) and interactive (plotly) time series charts.
plot_time_series(prices, date, adjusted,
.title = paste0("Adjusted closing price for ", params$symbol),
.plotly_slider = TRUE)
The table below displays the daily price data for TSLA between 2011-01-01 and 2021-04-07. A concise, interactive table is created with the reactable package.
reactable(prices,
resizable = TRUE,
filterable = TRUE,
searchable = TRUE)